home *** CD-ROM | disk | FTP | other *** search
/ Garbo / Garbo.cdr / mac / cdev / clrnxtwd.sit / NeXT WDEF.c < prev    next >
C/C++ Source or Header  |  1989-11-10  |  15KB  |  468 lines

  1. /*
  2.             ╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤
  3.             My Window Definition Procedure
  4.             ╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤
  5.             
  6.             This handles that odd window.
  7.             
  8.             ╤╤╤╤╤╤╤╤
  9.             89/04/20
  10.             ╤╤╤╤╤╤╤╤
  11.             
  12.             1.0      89/03/31    First draft based on clock window def proc
  13.                             (+A5 games).
  14.                   89/04/05    Fixed problem with zoom box hilite
  15.                   89/04/06    Fixed zooming
  16.                   89/04/07    Minor changes in draw, chose from two gray patterns
  17.                             to avoid odd mismatches in window dragged onscreen 
  18.                             from offscreen, added proper plainDBox & altDBoxProc 
  19.                             variations, special cased zero width titles.
  20.             1.1      89/04/09    Odd half erased scroll bar startup MPW adjusted
  21.                             [see drawGrowIcon()]
  22.             1.2      89/04/09    Fixed problem with userState updates. Working on colors!
  23.                   89/04/11    Changed size box to chevrons.
  24.                   89/04/12    Made sure inGrow only returned on hilited windows.
  25.                   89/04/20    Added Apples screenBits workaround and scroll area 
  26.                               to grow image.
  27.             2.0   89/11/10  Finished color additions and cleaned up other
  28.                             assorted bugs. JNP
  29.             
  30.             ╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤
  31.             Public Domain 1989 by Appropriate Technology
  32.             ╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤
  33.             
  34.             Please send a copy of changes/improvements to:
  35.             
  36.             Eric Celeste, Appropriate Technology, 358 North Parkview, Columbus, OH 43209, USA.
  37.             CompuServe: 76146,724. MacNET: Celeste.
  38.             
  39.             ╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤
  40.             Note: This WDEF is coded in THINK C 4.0 from Think Technologies
  41.             ╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤
  42.  
  43. Changes made by Josh Pritikin (11.10.89):
  44. 1. In calculateMyWindow I added a test to see if we have a color window.
  45. 2. I removed the ugly StuffHex calls and speeded the pattern packing up.
  46. 3. I added a gunk of code and special casing to totally support ColorQD!
  47. 4. The code is admitably gross in some (most) places but it works and should
  48.     serve as an example of what not to make your code look like.
  49.  
  50. GEnie:            J.Pritikin
  51. AppleLink:        D4991    (<- this will change soon)
  52. Internet:        6500stom@ucsbuxa.ucsb.edu
  53.  
  54. */
  55.  
  56. #include <Color.h>
  57. #include <MacTypes.h>
  58. #include <MemoryMgr.h>
  59. #include <MenuMgr.h>
  60. #include <OSUtil.h>
  61. #include <Quickdraw.h>
  62. #include <ToolboxUtil.h>
  63. #include <WindowMgr.h>
  64. #include <Global.h>
  65.  
  66. /*
  67.             ╤╤╤╤╤╤╤╤╤
  68.             Constants
  69.             ╤╤╤╤╤╤╤╤╤
  70. */
  71.  
  72. /* YOU ABSOLUTELY NEED TO DEFINE THIS WHEN YOUR RUNNING THE TESTER */
  73. /* #define testing */
  74.  
  75. #define commandKeyCode        0x00008000        /* the keymap mask for the command key */
  76. #define optionKeyCode        0x00000004        /* the keymap mask for the option key */
  77.  
  78. /*
  79.             ╤╤╤╤╤
  80.             Types
  81.             ╤╤╤╤╤
  82. */
  83.  
  84. typedef struct {
  85.     Rect        userState, stdState;
  86.     Boolean        buttonState;
  87. } WSDRecord, *WSDPointer, **WSDHandle;
  88.  
  89. #define buttonState    (**(WSDHandle)(*(WindowPeek)window).dataHandle).buttonState
  90.  
  91. #ifdef testing
  92. pascal long nextWDEF( variation, window, message, parameter )
  93. #else
  94. pascal long main( variation, window, message, parameter )
  95. #endif
  96.     short        variation;        /* variation code on this type window */
  97.     WindowPtr    window;            /* pointer to the window */
  98.     short        message;        /* what does the window manager want us to do? */
  99.     long        parameter;        /* parameter used for many things */
  100. {
  101.     long        result;            /* the return code for the function */
  102.     long hitMyWindow(/* variation, window, parameter */);
  103.     
  104.     #ifdef testing
  105.     SetUpA5();
  106.     #else        /* this stuff lets us reference thePort, otherwise we don't need it */
  107.     /* RememberA0();
  108.     SetUpA4(); */
  109.     #endif
  110.     
  111.     result = nil;
  112.     
  113.     switch( message ) {
  114.     case( wDraw ):
  115.         drawMyWindow( variation, window, parameter );
  116.         break;
  117.     case( wHit ):
  118.         result = hitMyWindow( variation, window, parameter );
  119.         break;
  120.     case( wCalcRgns ):
  121.         calculateMyWindow( variation, window, parameter );
  122.         break;
  123.     case( wNew ):
  124.         setupWindow( variation, window, parameter );
  125.         break;
  126.     case( wDispose ):
  127.         killWindow( variation, window, parameter );
  128.         break;
  129.     case( wGrow ):
  130.         growMyWindow( variation, window, parameter );
  131.         break;
  132.     case( wDrawGIcon ):
  133.         drawGrowIcon( variation, window, parameter );
  134.         break;
  135.     }
  136.     
  137.     #ifdef testing
  138.     RestoreA5();
  139.     #else
  140.     /* RestoreA4(); */
  141.     #endif
  142.     
  143.     return( result );
  144. }
  145.  
  146. /*╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤
  147.             where was my window hit?
  148. ╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤*/
  149. long hitMyWindow( variation, window, parameter )
  150.     short        variation;        /* variation code on this type window */
  151.     WindowPtr    window;            /* pointer to the window */
  152.     long        parameter;        /* parameter used for many things */
  153. {
  154.     Point        hitLocation;
  155.     Rect        windowRect, thisRect;
  156.     long        result;
  157.     
  158.     result = wNoHit;
  159.     
  160.     SetPt( &hitLocation, LoWord( parameter ), HiWord( parameter ) );
  161.     
  162.     if ( PtInRgn( hitLocation, (*(WindowPeek)window).strucRgn ) ) {
  163.                 
  164.         windowRect = (**(*(WindowPeek)window).strucRgn).rgnBBox;
  165.         
  166.         if ( PtInRgn( hitLocation, (*(WindowPeek)window).contRgn ) ) {
  167.         
  168.             result = wInContent;                    /* in the content region */
  169.             
  170.             if ( (*(WindowPeek)window).hilited ) {
  171.                 if ( variation == documentProc || variation == (documentProc+8) ) {
  172.                     SetRect( &thisRect, 
  173.                         windowRect.right     - 16, 
  174.                         windowRect.bottom     - 16,
  175.                         windowRect.right     - 4,
  176.                         windowRect.bottom     - 4
  177.                     );
  178.                     if ( PtInRect( hitLocation, &thisRect ) ) {
  179.                         result = wInGrow;
  180.                     }
  181.                 }
  182.             }
  183.  
  184.         } else {
  185.             
  186.             result = wInDrag;                        /* in the drag area unless */
  187.             
  188.             if ( (*(WindowPeek)window).hilited ) {
  189.                 if ( (*(WindowPeek)window).goAwayFlag ) {
  190.                     SetRect( &thisRect, 
  191.                         windowRect.left     + 4, 
  192.                         windowRect.top         + 4,
  193.                         windowRect.left     + 16,
  194.                         windowRect.top         + 16
  195.                     );
  196.                     if ( PtInRect( hitLocation, &thisRect ) ) {
  197.                         result = wInGoAway;
  198.                     }
  199.                 }
  200.                 if ( (result == wInDrag) 
  201.                     && ( variation == documentProc || variation == (documentProc+8) ) 
  202.                     ) {
  203.                     SetRect( &thisRect, 
  204.                         windowRect.right     - 16, 
  205.                         windowRect.bottom     - 16,
  206.                         windowRect.right     - 4,
  207.                         windowRect.bottom     - 4
  208.                     );
  209.                     if ( PtInRect( hitLocation, &thisRect ) ) {
  210.                         result = wInGrow;
  211.                     }
  212.                 }
  213.                 if ( (result == wInDrag) 
  214.                     && (*(WindowPeek)window).spareFlag 
  215.                     ) {
  216.                     SetRect( &thisRect, 
  217.                         windowRect.right     - 16, 
  218.                         windowRect.top         + 4,
  219.                         windowRect.right     - 4,
  220.                         windowRect.top         + 16
  221.                     );
  222.                     if ( PtInRect( hitLocation, &thisRect ) ) {
  223.                         if ( (*(WindowPeek)window).dataHandle != nil ) {
  224.                             thisRect = (**(*(WindowPeek)window).contRgn).rgnBBox;
  225.                             if ( EqualRect (
  226.                                 &((**(WSDHandle)(*(WindowPeek)window).dataHandle).stdState),
  227.                                 &thisRect
  228.                             ) ) {
  229.                                 result = wInZoomIn;
  230.                             } else {
  231.                                 (**(WSDHandle)(*(WindowPeek)window).dataHandle).userState 
  232.                                 = thisRect;
  233.                                 result = wInZoomOut;
  234.                             }
  235.                         } /* datahandle */
  236.                         
  237.                     } /* in the zoom box */
  238.                     
  239.                 } /* still dragging & zoomable */
  240.                 
  241.             } /* a hilited window */
  242.         
  243.         } /* else not in content region */
  244.         
  245.     } /* in the structure region */
  246.     
  247.     return( result );
  248. } /* end of hitMyWindow() */
  249.  
  250. /*╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤
  251.             calculate the regions of my window
  252. ╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤*/
  253. calculateMyWindow( variation, window, parameter )
  254.     short        variation;        /* variation code on this type window */
  255.     WindowPtr    window;            /* pointer to the window */
  256.     long        parameter;        /* parameter used for many things */
  257. {
  258.     Rect        windowRect, portR;
  259.     
  260.     windowRect = (*window).portRect;
  261.                                             /* a fix for CWindowRecords */
  262.     if ((window->portBits.rowBytes & (3<<14)) == 0) {
  263.         OffsetRect( &windowRect, -window->portBits.bounds.left, -window->portBits.bounds.top );
  264.     } else {
  265.         portR = (**(*(CGrafPtr)window).portPixMap).bounds;
  266.         OffsetRect(&windowRect, -portR.left, -portR.top);
  267.     }
  268.     
  269.     RectRgn( (*(WindowPeek)window).contRgn, &windowRect );
  270.     
  271.     switch ( variation ) {
  272.     case ( documentProc + 8):                    /* a zooming window */
  273.         if (!EqualRect(&((**(WSDHandle)(*(WindowPeek)window).dataHandle).stdState),&windowRect)){
  274.             (**(WSDHandle)(*(WindowPeek)window).dataHandle).userState = windowRect;
  275.         }
  276.     case ( documentProc ):                        /* a regular window */
  277.     case ( noGrowDocProc ):                        /* a regular window with no growing */
  278.         OpenRgn();
  279.             InsetRect( &windowRect, -4, -4 );
  280.             windowRect.top -= 16;                /* add room for the title bar */
  281.             MoveTo( windowRect.left, windowRect.top );
  282.             LineTo( windowRect.left, windowRect.bottom-2 );
  283.             LineTo( windowRect.left+2, windowRect.bottom );
  284.             LineTo( windowRect.right, windowRect.bottom );
  285.             LineTo( windowRect.right, windowRect.top+2 );
  286.             LineTo( windowRect.right-2, windowRect.top );
  287.             LineTo( windowRect.left, windowRect.top );
  288.         CloseRgn( (*(WindowPeek)window).strucRgn );
  289.         break;
  290.     case ( dBoxProc ):                            /* dialog box variation */
  291.         OpenRgn();
  292.             InsetRect( &windowRect, -8, -8 );
  293.             MoveTo( windowRect.left, windowRect.top );
  294.             LineTo( windowRect.left, windowRect.bottom-2 );
  295.             LineTo( windowRect.left+2, windowRect.bottom );
  296.             LineTo( windowRect.right, windowRect.bottom );
  297.             LineTo( windowRect.right, windowRect.top+2 );
  298.             LineTo( windowRect.right-2, windowRect.top );
  299.             LineTo( windowRect.left, windowRect.top );
  300.         CloseRgn( (*(WindowPeek)window).strucRgn );
  301.         break;
  302.     case ( plainDBox ):                            /* plain box variation */
  303.         InsetRect( &windowRect, -1, -1 );
  304.         RectRgn( (*(WindowPeek)window).strucRgn, &windowRect );
  305.         break;
  306.     case ( altDBoxProc ):                        /* shadow box variation */
  307.         OpenRgn();
  308.             InsetRect( &windowRect, -1, -1 );
  309.             MoveTo( windowRect.left, windowRect.top );
  310.             LineTo( windowRect.left, windowRect.bottom );
  311.             LineTo( windowRect.left+2, windowRect.bottom );
  312.             LineTo( windowRect.left+2, windowRect.bottom+2 );
  313.             LineTo( windowRect.right+2, windowRect.bottom+2 );
  314.             LineTo( windowRect.right+2, windowRect.top+2 );
  315.             LineTo( windowRect.right, windowRect.top+2 );
  316.             LineTo( windowRect.right, windowRect.top );
  317.             LineTo( windowRect.left, windowRect.top );
  318.         CloseRgn( (*(WindowPeek)window).strucRgn );
  319.         break;
  320.     }
  321.         
  322. } /* end of calculateMyWindow() */
  323.  
  324. /*╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤
  325.             draw the growing outline, the pen is already set
  326. ╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤*/
  327. growMyWindow( variation, window, parameter )
  328.     short        variation;        /* variation code on this type window */
  329.     WindowPtr    window;            /* pointer to the window */
  330.     long        parameter;        /* parameter used for many things */
  331. {
  332.     Rect        growingRect;
  333.     
  334.     growingRect = *(Rect *)parameter;
  335.     
  336.     growingRect.top -= 20;                                    /* out to full size */
  337.     growingRect.left -= 4;
  338.     growingRect.bottom += 4;
  339.     growingRect.right += 4;
  340.     
  341.     FrameRect( &growingRect );                                /* the frame */
  342.     
  343.     growingRect.top += 19;
  344.     
  345.     MoveTo( growingRect.left, growingRect.top );            /* the title bar area */
  346.     LineTo( growingRect.right, growingRect.top );
  347.     
  348.     MoveTo( growingRect.right - 19, growingRect.top );         /* the scroll area */
  349.     LineTo( growingRect.right - 19, growingRect.bottom );
  350.     MoveTo( growingRect.left, growingRect.bottom - 19 );
  351.     LineTo( growingRect.right, growingRect.bottom - 19 );
  352.     
  353. } /* end of growMyWindow() */
  354.  
  355. /*╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤
  356.             draw the size box and the scroll frame
  357. ╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤*/
  358. drawGrowIcon( variation, window, parameter )
  359.     short        variation;        /* variation code on this type window */
  360.     WindowPtr    window;            /* pointer to the window */
  361.     long        parameter;        /* parameter used for many things */
  362. {
  363.     Rect        thisRect;
  364.     
  365.     SetPort( window );
  366.     
  367.     /* ╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤ draw scroll bar frame */
  368.     
  369.     thisRect = (*window).portRect;
  370.     thisRect.left = thisRect.right - 15;
  371.     MoveTo( thisRect.left, thisRect.top );
  372.     LineTo( thisRect.left, thisRect.bottom );
  373.  
  374.     thisRect.top = thisRect.bottom - 15;
  375.     thisRect.left = (*window).portRect.left;
  376.     MoveTo( thisRect.left, thisRect.top );
  377.     LineTo( thisRect.right, thisRect.top );
  378.         
  379.     /* ╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤ draw the sizing box */
  380.     
  381.     thisRect = (*window).portRect;
  382.     thisRect.left = thisRect.right - 14;
  383.     thisRect.top = thisRect.bottom - 14;    
  384.     
  385.     EraseRect( &thisRect );                    /* clear it out in case program doesn't */
  386.     
  387.     if ( (*(WindowPeek)window).hilited ) {    /* the size box chevrons */
  388.         thisRect.top += 4;
  389.         thisRect.left += 4;
  390.         thisRect.bottom -= 2;
  391.         thisRect.right -= 2;
  392.         PaintRect( &thisRect );
  393.         OffsetRect( &thisRect, -2, -2 );
  394.         thisRect.right -= 1;
  395.         thisRect.bottom -= 1;
  396.         EraseRect( &thisRect );
  397.         thisRect.right -= 1;
  398.         thisRect.bottom -= 1;
  399.         PaintRect( &thisRect );
  400.         thisRect.right -= 3;
  401.         thisRect.bottom -= 3;
  402.         EraseRect( &thisRect );
  403.     }
  404.     
  405. } /* end of drawGrowIcon() */
  406.  
  407. /*╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤
  408.             set up the window
  409. ╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤*/
  410. setupWindow( variation, window, parameter )
  411.     short        variation;        /* variation code on this type window */
  412.     WindowPtr    window;            /* pointer to the window */
  413.     long        parameter;        /* parameter used for many things */
  414. {
  415.     SysEnvRec    thisWorld;
  416.     OSErr        error;
  417.     GDHandle    thisDevice;
  418.     Rect        thisRect;
  419.     GrafPtr     savedPort;   
  420.     GrafPort    tempPort; 
  421.     
  422.     (*(WindowPeek)window).dataHandle = NewHandle( (long)sizeof(WSDRecord) );
  423.     
  424.     if ( variation == (documentProc+8) ) {
  425.         (*(WindowPeek)window).spareFlag = true;
  426.         if ( (*(WindowPeek)window).dataHandle != nil ) {
  427.             error = SysEnvirons( 1, &thisWorld );
  428.             /* if ( error == noErr && thisWorld.hasColorQD ) {
  429.                 thisDevice = GetMainDevice();
  430.                 thisRect = (**thisDevice).gdRect;
  431.                 thisRect.top += MBarHeight;
  432.             } else */ {
  433.                 GetPort(&savedPort);                /* finding screenBits w/o globals */
  434.                 OpenPort(&tempPort);
  435.                 thisRect = tempPort.portRect;
  436.                 SetPort(savedPort); 
  437.                 ClosePort(&tempPort);
  438.                 thisRect.top += MBarHeight;            /* make way for the menubar */
  439.             }
  440.             InsetRect( &thisRect, 4, 4 );            /* make way for edges */
  441.             thisRect.top += 16;                        /* make way for what's left of title */
  442.             (**(WSDHandle)(*(WindowPeek)window).dataHandle).stdState = thisRect;
  443.             (**(WSDHandle)(*(WindowPeek)window).dataHandle).userState = thisRect;
  444.         }
  445.     } else {
  446.         (*(WindowPeek)window).spareFlag = false;
  447.         /* (*(WindowPeek)window).dataHandle = nil; */
  448.     }
  449.     buttonState = false;
  450.     
  451. } /* end of setupWindow() */
  452.  
  453. /*╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤
  454.             kill the window
  455. ╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤╤*/
  456. killWindow( variation, window, parameter )
  457.     short        variation;        /* variation code on this type window */
  458.     WindowPtr    window;            /* pointer to the window */
  459.     long        parameter;        /* parameter used for many things */
  460. {
  461.     Rect        growingRect;
  462.     
  463.     /* if ( (*(WindowPeek)window).spareFlag ) { */
  464.         DisposHandle( (*(WindowPeek)window).dataHandle );
  465.         (*(WindowPeek)window).dataHandle = nil;
  466.     /* } */
  467.     
  468. } /* end of setupWindow() */